from iterators.concreteaggregate import ConcreteAggregate


# 客户端
def client_code(aggregate):
    iterator = aggregate.create_iterator()

    while iterator.has_next():
        value = iterator.next()
        print(value)

# 使用
collection = [1, 2, 3, 4, 5]
aggregate = ConcreteAggregate(collection)
client_code(aggregate)
